package com.shared.server.impl;

import com.shared.dao.PCommentMapper;
import com.shared.dao.PGoodsAlbumMapper;
import com.shared.dao.PGoodsCoverMapper;
import com.shared.dao.PGoodsMapper;
import com.shared.pojo.PComment;
import com.shared.pojo.PGoods;
import com.shared.pojo.PGoodsCover;
import com.shared.server.PGoodsServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import java.util.Set;

@Service
public class PGoodsServerImpl implements PGoodsServer {
    @Autowired
    private PGoodsMapper pGoodsMapper;
    @Autowired
    private PGoodsAlbumMapper pGoodsAlbumMapper;
    @Autowired
    private PGoodsCoverMapper pGoodsCoverMapper;
    @Autowired
    private PCommentMapper pCommentMapper;

    @Override
    public List<PGoods> findAllGoods() {
        return pGoodsMapper.findAllGoods();
    }

    @Override
    public List<PGoods> findById(Integer id) {
        return pGoodsMapper.findGoodsByid(id);
    }

    @Override
    public List<PGoodsCover> findCoverByGid(Integer id) {
        return pGoodsCoverMapper.findCoverByGid(id);
    }

    @Override
    public List<PComment> findCommentByGid(Integer id) {
        return pCommentMapper.findCommentByGid(id);
    }

    @Override
    public List<PGoods> findGoodsByTYPE(Integer TYPE) {
        return pGoodsMapper.findGoodsByTYPE(TYPE);
    }

}
